//
//  NewsFlashHeaderView.m
//  AutoHome
//
//  Created by wqh on 15-5-15.
//  Copyright (c) 2015年 Wqh. All rights reserved.
//

#import "NewsFlashHeaderView.h"

@implementation NewsFlashHeaderView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)showDataWithDict:(NSDictionary *)dict {
    self.typeNameLabel.text = dict[@"newstypeanme"];
    self.titleLabel.text = dict[@"title"];
    self.authorLabel.text = [NSString stringWithFormat:@"编辑:%@",dict[@"newsauthor"]];
    self.timeLabel.text = [NSString stringWithFormat:@"%@位观众",dict[@"reviewcount"]];
    if ([[dict[@"newsstate"] stringValue] isEqualToString:@"1"] ) {
        self.stateLabel.text = @"播报中";
        self.stateLabel.textColor = [UIColor whiteColor];
        self.stateLabel.backgroundColor = [UIColor customBlueColor];
    }else {
        self.stateLabel.text = @"播报结束";
        self.stateLabel.textColor = [UIColor grayColor];
        self.stateLabel.backgroundColor = [UIColor whiteColor];
    }
}

@end
